package org.nanotek.lucene.beans;

import java.awt.Component;
import java.net.URI;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.lucene.index.IndexWriter;
import org.nanotek.Base;

@SuppressWarnings({"serial", "unchecked"})
public class DocumentBuilder implements Base<String> {
	
	private String id;
	private Date creationDate;
	private String documentName; 
	private URI documentConfigurerURI; 
	private Map<?,?> fieldConfigMap; 
	
	public DocumentBuilder() {
		fieldConfigMap = new HashMap<String, FieldBuilder>();
	}

	public String getDocumentName() {
		return documentName;
	}

	public void setDocumentName(String documentName) {
		this.documentName = documentName;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public URI getDocumentConfigurerURI() {
		return documentConfigurerURI;
	}

	public void setDocumentConfigurerURI(URI documentConfigurerURI) {
		this.documentConfigurerURI = documentConfigurerURI;
	}

	public void setId(String id) {
		this.id = id;
	}

	public void setFieldConfigMap(Map<?,?> fieldConfigMap) {
		this.fieldConfigMap = (Map<String, FieldBuilder>) fieldConfigMap;
	}
	
	@Override
	public String getId() {
		return id;
	}
	
	public Map<?,?>  getFieldConfigMap() {
		return (Map<String, FieldBuilder>) fieldConfigMap;
	}

	public IndexWriter configureIndexWriter() {
		return null;
	}

	public Collection<?> getFields() { 
		return  fieldConfigMap.values();
	}

	public void build(Component cmp) {
		
	}
}
